import { request } from '@boeyo/portal';

export const getNormalList = (params: any) => {
  return request({
    url: '/alarm/list',
    method: 'GET',
    params,
  });
};

export const updateStatus = (params: any) => {
  return request({
    url: '/tag/updateStatus',
    method: 'PUT',
    params,
  });
};

/**
 * 常规告警策略树形列表
 */
export const getIndicatorObjTree = (data) => {
  return request({
    url: '/alarm/monitorTree',
    method: 'POST',
    data,
  });
};
/**
 *获取主机列表
 */
export const getHostList = async (params: any) => {
  return {
    rows: [
      {
        id: 1,
        name: '192.168.20.68',
      },
      {
        id: 2,
        name: '192.168.10.28',
      },
      {
        id: 3,
        name: '192.168.10.12',
      },
      {
        id: 4,
        name: '192.168.10.66',
      },
    ],
    total: 4,
  };
  // return request({
  //   url: '/tag/updateStatus',
  //   method: 'GET',
  //   params,
  // });
};
export const addNormal = (params: any) => {
  return request({
    url: '/tag/updateStatus',
    method: 'POST',
    params,
  });
};
export const deleteNormal = (ids: number[]) => {
  return request({
    url: `/tag/updateStatus/${ids}`,
    method: 'DELETE',
  });
};
